import BarChartWidget from "../../../src/widget/chart/BarChartWidget"
import { add_chart_rainfall_widget } from "./widget_chart_rainfall";


export function add_widget_chart(container_id){

    //add_chart_bar_widget(container_id);
    add_chart_rainfall_widget(container_id);
}

/**
 * 添加Chart柱状图widget
 * @param {} container_id 
 */
function add_chart_bar_widget(container_id){

    let url = "/data/chart/bar.json";
    fetch(url).then(resp=>{
        return resp.json();
    })
    .then(json=>{
        let widget = new BarChartWidget(container_id);
        widget.setData(json.data);
    });
}

